<?php

/**
 * Menashop
 *
 * LICENSE
 *
 * This source file is subject to the license that is bundled
 * with this project in the file LICENSE.txt
 *
 * @category   Zend
 * @package    Storefront_Model
 * @subpackage FormCatalog
 * @copyright  Copyright (c) 2011 Menashop UA Inc. (http://www.menashop.com.ua)
 * @license    LICENSE.txt
 * @version    1.0.0
 * @since      File available since Release 1.0.0
 */

/**
 * The form for login
 * 
 * @category   Zend
 * @package    Storefront_Model
 * @subpackage FromCatalog
 * @copyright  Copyright (c) 2011 Menashop UA Inc. (http://www.menashop.com.ua)
 * @license    LICENSE.txt
 */
class Storefront_Model_FormCatalog extends Zend_Form
{

    public function init()
    {
        $this->setMethod('get');

        $rows = new Zend_Form_Element_Select('rows');
        $rowsArr = array(10, 20, 50);
        foreach ($rowsArr as $value) {
            $rows->addMultiOption($value, $value);
        }
        $rows->removeDecorator('label');
        $rows->removeDecorator('htmlTag');
        $rows->removeDecorator('Errors');

        $sort = new Zend_Form_Element_Select('sort');
        $sortArr = array('name', 'price');
        foreach ($sortArr as $value) {
            $sort->addMultiOption($value, $value);
        }
        $sort->removeDecorator('label');
        $sort->removeDecorator('htmlTag');
        $sort->removeDecorator('Errors');

        $direction = new Zend_Form_Element_Select('direction');
        $directionArr = array('asc', 'desc');
        foreach ($directionArr as $value) {
            $direction->addMultiOption($value, $value);
        }
        $direction->removeDecorator('label');
        $direction->removeDecorator('htmlTag');
        $direction->removeDecorator('Errors');

        $this->setDecorators(array(array('ViewScript', array('viewScript' => '_form_catalog.phtml'))));
        $this->addElements(array($rows, $sort, $direction));
    }

}

